<?php
class Job_template_model extends CI_Model {

	public function __construct()
	{
		$this->load->database();
	}
	public function get_page_job_template($num, $offset)
	{
		$query = $this->db->get('job_template',$num, $offset);
		return $query->result_array();
	}
	public function get_job_template($id = FALSE)
	{
		if ($id === FALSE)
		{
			$query = $this->db->get('job_template');
			return $query->result_array();
		}
		else{

		}
		$query = $this->db->get_where('job_template', array('id' => $id));
		return $query->row_array();
	}
	public function insert_job()
	{
		$this->load->helper('url');

		$data = array(
    'id' => $this->input->post('id'),
    'url' => $this->input->post('url')
		);

		return $this->db->insert('job_template', $data);
	}
	public function edit_job()
	{
		$data = array(
    		'id' => $this->input->post('id'),
		);
		$this->db->where('id', $id);
		$this->db->update('job_template',$data);
	}
	public function delete_job($id)
	{
		$this->db->where('id', $id);
		$this->db->delete('job_template');
	}
}
